<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <title>Title</title>
</head>
<body>

<form action="http://www.baidu.com" METHOD="POST">
    <input type="text">
    <input type="submit" value="提交">
</form>


<script src="jquery-1.12.4.js"></script>
<script>
    $(':submit').click(function () {
        var v = $(this).prev().val();
        tag = v.length > 0 ? true : false; alert('can not empty!!');
        return tag;
    })
</script>
</body>
</html>